package gate

import (
	"znet/leaf/gate"
	"demo/gate/conf"
	"time"
	"demo/gate/agents"
)

var (
	Module	 = new(Gate)
)
type Gate struct {
	*gate.Gate
}
func (this *Gate) OnInit() {
	this.Gate = &gate.Gate{
		MaxConnNum:      conf.Server.Gate.MaxConnNum,
		PendingWriteNum: conf.Server.Gate.PendingWriteNum,
		MaxMsgLen:       uint32(conf.Server.Gate.MaxMsgLen),
		WSAddr:          conf.Server.Gate.WSAddr,
		HTTPTimeout:     time.Duration(conf.Server.Gate.HTTPTimeout)*time.Second,
		TCPAddr:         conf.Server.Gate.TCPAddr,
		LenMsgLen:       conf.Server.Gate.LenMsgLen,
		LittleEndian:    conf.Server.Gate.LittleEndian,
		AgentChanRPC:    agents.ChanRPC,
		Processor:       Processor,
	}
}